//
//  BCOderDetailAlertCell.m
//  BangcaiBuy
//
//  Created by lsy on 16/7/13.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCOderDetailAlertCell.h"

@interface BCOderDetailAlertCell ()
{
    UILabel *nameLab;
    UILabel *priceLab;
    UILabel *amountLab;
    UILabel *totalLab;
}


@end

@implementation BCOderDetailAlertCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    nameLab = [[UILabel alloc] init];
    priceLab = [[UILabel alloc] init];
    amountLab = [[UILabel alloc] init];
    totalLab = [[UILabel alloc] init];
    nameLab.font = [UIFont systemFontOfSize:12];
    priceLab.font =[UIFont systemFontOfSize:12];
    amountLab.font = [UIFont systemFontOfSize:12];
    totalLab.font = [UIFont systemFontOfSize:12];;
    nameLab.textColor = [UIColor colorWithRed:0.514  green:0.514  blue:0.514 alpha:1];
    priceLab.textColor = [UIColor colorWithRed:0.514  green:0.514  blue:0.514 alpha:1];
    amountLab.textColor = [UIColor colorWithRed:0.514  green:0.514  blue:0.514 alpha:1];
    totalLab.textColor = [UIColor colorWithRed:0.514  green:0.514  blue:0.514 alpha:1];
    [self.contentView addSubview:nameLab];
    [self.contentView addSubview:priceLab];
    [self.contentView addSubview:amountLab];
    [self.contentView addSubview:totalLab];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.and.bottom.mas_equalTo(0);
        make.left.mas_equalTo(12);
        make.width.mas_equalTo(100 *wx);
    }];
    [priceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(nameLab.mas_right).with.offset(20*wx);
        make.width.mas_equalTo(60 *wx);
        make.top.and.bottom.mas_equalTo(0);
    }];
    
    [amountLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(priceLab.mas_right).with.offset(3*wx);
        make.width.mas_equalTo(30 *wx);
        make.top.and.bottom.mas_equalTo(0);
    }];
    [totalLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(amountLab.mas_right).with.offset(15*wx);
        make.width.mas_equalTo(70 *wx);
        make.top.and.bottom.mas_equalTo(0);
        
    }];
    
    nameLab.text = _name;
    priceLab.text = _price;
    amountLab.text = _amount;
    totalLab.text = _totalPrice;
}

@end
